<?php
class ApiAdvertiseController extends ApiController
{
  public function indexAction()
  {
    $advertiseModel = $this->getModel('advertise');
    $page = max(intval($this->req->getQueryTrim('page', 1)), 1);
    $rows = intval($this->req->getQueryTrim('rows', 15));
    return $this->okReturn(['list' => $advertiseModel->getAdvertisesList([
     'status' => Advertise::IS_ONLINE
    ], $page, $rows)]);
  }
}